/////////////////////////////////////////////////////////////////////////////
//
// CodeLib.h
//
// Author : L.F.
// Date   : 2006.10.24
//
/////////////////////////////////////////////////////////////////////////////
#pragma once

#include <string>

class CCodeLib
{
// Construction
public:
	CCodeLib();
	virtual ~CCodeLib();

// Implementation
public:
	// UTF-8 to Unicode
	static void UTF8ToUnicode( WCHAR* pwchOut, const char* pchIn );

	static void UnicodeToGB2312( char* pchOut,  unsigned short uData );

	static void UTF8ToGB2312( std::string& strOut, const char* pchIn, int nLen );

	// Unicode to UTF-8

	static void GB2312ToUTF8( std::string& strOut, const char* pchIn, int nLen );

	static void UnicodeToUTF8( char* pchOut, WCHAR* pwchIn );

	static void GB2312ToUnicode( WCHAR* pwchOut, const char* pchIn );

	static string GetFileName(string strFilePath);
};